    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// demo接口1
export const demo1 = (data:any) => {
    return service({
        url: '/user/user/demo1/' + data,
        method: 'post'
    })
};


// demo接口2
export const demo2 = (data:any) => {
    return service({
        url: '/user/user/demo2',
        method: 'post',
        data
    })
};


// demo接口2
export const login = (data:any) => {
    return service({
        url: '/user/index/login',
        method: 'post',
        data
    })
};
/**
 * 
 * @param d列表
 * @returns 
 */
export const selectList = (data:any) => {
    return service({
        url: '/user/index/selectList',
        method: 'post',
        data
    })
};

// 导航侧边栏
export const getMenuTree = (userId:any) => {
    return service({
        url: '/user/index/getMenuTree/'+userId,
        method: 'post',
    })
};



// 修改
export const updateFile = (data:any) => {
    return service({
        url: '/user/index/updateFile',
        method: 'post',
        data
    })
};



// 品牌列表
export const getBrandList = (data:any) => {
    return service({
        url: '/user/index/getBrandList',
        method: 'post',
        data
    })
};

// 单删
export const deleteById = (userId:any) => {
    return service({
        url: '/user/index/deleteById/'+userId,
        method: 'post'
    })
};

// 批量删除
export const deleteAll = (data:any) => {
    return service({
        url: '/user/index/deleteAll',
        method: 'post',
        data
    })
};

// 审核
export const checkUser = (data:any) => {
    return service({
        url: '/user/index/checkUser',
        method: 'post',
        data
    })
};

// 添加
export const addBrand = (data:any) => {
    return service({
        url: '/user/index/addBrand',
        method: 'post',
        data
    })
};

// 修改
export const updateBrandStatus = (data:any) => {
    return service({
        url: '/user/index/updateBrandStatus',
        method: 'post',
        data
    })
};

// 修改
export const getTypeTree = () => {
    return service({
        url: '/user/index/getTypeTree',
        method: 'get',
    })
};


// 单删
export const deleteTypeById = (typeId:any) => {
    return service({
        url: '/shop/type/deleteTypeById/'+typeId,
        method: 'post'
    })
};

// 修改
export const setTypeStatus = (typeId:any,typeStatus:any) => {
    return service({
        url: '/shop/type/setTypeStatus/'+typeId+"/"+typeStatus,
        method: 'post'
    })
};
/**
 * 上传图片
 */
export const uploadFile = (data:any) => {
    return service({
        url: '/shop/type/uploadFile',
        method: 'post',
        data
    })
};
/**
 * 
 * @param data 添加
 * @returns 
 */
export const Addtypee = (data:any) => {
    return service({
        url: '/shop/type/addType',
        method: 'post',
        data
    })
};
/**
 * 
 * @param data 修改商品类型
 * @returns 
 */
export const updateType = (data:any) => {
    return service({
        url: '/shop/type/updateType',
        method: 'post',
        data
    })
};
// 商品列表
export const getProdList = (data:any) => {
    return service({
        url: '/shop/prod/getProdList',
        method: 'post',
        data
    })
};
// 添加商品
export const addProd = (data:any) => {
    return service({
        url: '/shop/prod/addProd',
        method: 'post',
        data
    })
};
// 获取供应商列表
export const getApprListAll = () => {
    return service({
        url: '/shop/prod/getApprListAll',
        method: 'post',
    })
};
//获取所有品牌列表
export const getBrandListAll = () => {
    return service({
        url: '/shop/prod/getBrandListAll',
        method: 'post',
    })
};
//查询所有的单位
export const getUnitListAll = () => {
    return service({
        url: '/shop/prod/getUnitListAll',
        method: 'post',
    })
};
//获取所有标签
export const getTagListAll= () => {
    return service({
        url: '/shop/tag/getTagListAll',
        method: 'post',
    })
};
// 商品类型的树
export const getTypeSelectTree= () => {
    return service({
        url: '/user/index/getTypeSelectTree',
        method: 'post',
    })
};
// 批量删除
export const deleteAllProd= (data:any) => {
    return service({
        url: '/shop/prod/deleteAllProd',
        method: 'post',
        data
    })
};
//添加商品附件
export const addProdAtta= (data:any) => {
    return service({
        url: '/shop/prod/addProdAtta',
        method: 'post',
        data
    })
};
//分页获取商品详情
export const getProdInfoList= (data:any) => {
    return service({
        url: '/shop/prod/getProdInfoList',
        method: 'post',
        data
    })
};
